<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>广告位编辑</title>
<#include "/WEB-INF/content/module-edit.html">
<script src="${request.contextPath}/res/kindeditor/kindeditor.js"></script>
<script src="${request.contextPath}/res/kindeditor/lang/zh_CN.js"></script>
<script type="text/javascript">
var isEnableValue=[
	{"id":"0","text":"不可用"},
	{"id":"1","text":"可用"}
];
$(function (){
	$("#isEnable").combobox({
  		valueField : 'id',
  		textField : 'text',
  		editable:true,
  		data:isEnableValue
  	});
})
function mySave(){
	 if (!$("#form").form('validate'))
		return; 
	 save();
}
</script>
<style>
.input-width{
	width: 95%;
}
</style>
 
</head>
<body class="easyui-layout">
	<div region="north" id="toolbar" style="background-color: #eee; padding: 5px; overflow: hidden;" border="false">
		<#if object.id?exists&&object.id!="">
			<@auth code="ad:pos:update">
				<a href="javascript:void(0);" class="easyui-linkbutton" plain="true" iconCls="icon-add" style="border: 1px solid #ccc" onclick="javascript:mySave()">保存</a>
			</@auth>
		<#else>
			<@auth code="ad:pos:create">
				<a href="javascript:void(0);" class="easyui-linkbutton" plain="true" iconCls="icon-add" style="border: 1px solid #ccc" onclick="javascript:mySave()">保存</a>
			</@auth>
		</#if>
		<a href="javascript:void(0);" class="easyui-linkbutton" plain="true" iconCls="icon-edit" style="border: 1px solid #ccc" onclick="javascript:cancel()">关闭</a>
	</div>
	<div region="center">
		<div id="p" class="easyui-panel" style="background: #fafafa; padding: 10px" fit="true" toolbar="#toolbar">
			<form id="form" method="post">
				<table class="form" cellspacing="0" style="width: 100%">
					<tbody style="border: 1px solid #ccc">
						<tr style="display: none;">
							<td colspan="6"><input id="_id" name="id" value="${(object.id)!}"></td>
						</tr>
						<tr>
							<td class="label">广告位名称：</td>
							<td>
								<input id="posName" name="posName" class="easyui-validatebox" required="true" value="${(object.posName)!}"/>
							</td>
							<td class="validate">*</td>
							<td class="label">广告位类型：</td>
							<td><input class="easyui-combobox" data-options=" valueField:'posTypeId',textField:'posTypeName',url:'${request.contextPath}/ad/pos/posType'"  id="posTypeId" name="posTypeId"  required="true" value="${object.posTypeId!1}" /></td>
							<td class="validate">*</td>	
						</tr>
						<tr>
							<td class="label">宽度：</td>
							<td>
								<input id="width" name="width" class="easyui-numberbox" min="1" max="9999" precision="1" required="true" value="${(object.width)!}"/>
							</td>
							<td class="validate">*</td>
							<td class="label">高度：</td>
							<td><input id="height" name="height" class="easyui-numberbox" min="1" max="9999" precision="1"  required="true" value="${(object.height)!}"/></td>
							<td class="validate">*</td>	
						</tr>
						<tr>
							<td class="label">是否可用：</td>
							<td>
								<input id="isEnable" name="isEnable" class="easyui-validatebox" required="true" value="${(object.isEnable)!1}"/>
							</td>
							<td class="validate">*</td>
						</tr>
					</tbody>
				</table>
			</form>
		</div>
	</div>
</body>
</html>